package com.milkshopbackend.milkshop.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@TableName("product")
public class Product {
    @TableId(type = IdType.AUTO)
    private Long id;

    private String name;
    private Long categoryId;
    private String description;
    private BigDecimal price;
    private String image;
    private Integer stock;
    private boolean status;
    @TableField("spec_type")
    private String specType;
    private Integer rating; // 商品评分
    private Integer sales; // 商品销量
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    private BigDecimal largePrice;
    private Integer largeStock;
    private BigDecimal mediumPrice;
    private Integer mediumStock;

    public boolean getStatus() {
        return status == true;
    }

    public BigDecimal getLargePrice() {
        return largePrice;
    }

    public void setLargePrice(BigDecimal largePrice) {
        this.largePrice = largePrice;
    }

    public Integer getLargeStock() {
        return largeStock;
    }

    public void setLargeStock(Integer largeStock) {
        this.largeStock = largeStock;
    }

    public BigDecimal getMediumPrice() {
        return mediumPrice;
    }

    public void setMediumPrice(BigDecimal mediumPrice) {
        this.mediumPrice = mediumPrice;
    }

    public Integer getMediumStock() {
        return mediumStock;
    }

    public void setMediumStock(Integer mediumStock) {
        this.mediumStock = mediumStock;
    }
}
